package com.shanxia.codec.enums;


public enum FunctionCode {
	CheckIn(0x01),
	CheckInAck(0x81),
	Heartbeat(0x02),
	HeartbeatAck(0x82),
	UpdateLocation(0x03),
	UpdateLocationAck(0x83),
	SetStrategry(0x10),
	SetStrategryAck(0x90),
	GetStrategry(0x11),
	GetStrategryAck(0x91),
	UploadWorkState(0x12),
	UploadWorkStateAck(0x92),
	ForceTurnOnOff(0x13),
	ForceTurnOnOffAck(0x93),
	UploadWorkState2(0x14),
	UploadWorkState2Ack(0x94),
	UploadAlarm(0x15),
	UploadAlarmAck(0x95),
	ResetController(0x1F),
	ResetControllerAck(0x9F),
	Unknown(0);

	private int value;

	FunctionCode(int v){
		value=v;
	}
	public byte getValue() {
		return (byte)value;
	}
	public static FunctionCode valueOf(byte v) {
		int temp=0;
		temp|=(v&0xFF);
		switch(temp) {
			case 0x01:return CheckIn;
			case 0x81:return CheckInAck;
			case 0x02:return Heartbeat;
			case 0x82:return HeartbeatAck;
			case 0x03:return UpdateLocation;
			case 0x83:return UpdateLocationAck;
			case 0x10:return SetStrategry;
			case 0x90:return SetStrategryAck;
			case 0x11:return GetStrategry;
			case 0x91:return GetStrategryAck;
			case 0x12:return UploadWorkState;
			case 0x92:return UploadWorkStateAck;
			case 0x13:return ForceTurnOnOff;
			case 0x93:return ForceTurnOnOffAck;
			case 0x14:return UploadWorkState2;
			case 0x94:return UploadWorkState2Ack;
			case 0x15:return UploadAlarm;
			case 0x95:return UploadAlarmAck;
			case 0x1F:return ResetController;
			case 0x9F:return ResetControllerAck;
			default:return Unknown;
		}
	}

}
